import request from "@/api";

// 查询列表
export function list(params) {
  return request({
    url: "/category/list",
    method: "get",
    params: params,
  });
}

// 保存
export function save(data) {
    return request({
      url: "/category/save",
      method: "post",
      data: data,
    });
  }

// 根据id获取详情
export function getById(id) {
  return request({
    url: "/category/getById",
    method: "get",
    params: {
        id:id
    },
  });
}

// 删除
export function deleteById(id) {
  return request({
    url: "/category/deleteById",
    method: "delete",
    params: {
        id:id
    },
  });
}

// 查询目录列表
export function getDirList() {
  return request({
    url: "/category/getDirList",
    method: "get",
  });
}

// 查询树
export function getTree() {
  return request({
    url: "/category/getTree",
    method: "get",
  });
}

// 查询分组选项
export function getOptions() {
  return request({
    url: "/category/getOptions",
    method: "get",
  });
}